<template>
	<div class='classList'>
		<div class="classList_tab">
			<u-tabs :list="list1" lineColor="#9013FE" lineWidth="20"
				itemStyle="padding-left: 66rpx; padding-right: 66rpx; height: 44px;" :activeStyle="{
			    color: '#9013FE',
			    fontWeight: 'bold',
			    transform: 'scale(1.05)'
			}" :inactiveStyle="{
			    color: '#999999',
			    transform: 'scale(1)'
			}" @change="changeEvent()"></u-tabs>
		</div>
		<div class="classTop">
			<pageList :list='classPageList' @upDate='upDate'></pageList>
		</div>
	</div>
</template>
<style lang="less">
	.classList {
		.classList_tab {
			background: #fff;
			padding: 10rpx 0;
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
		}

		.classTop {
			margin-top: 120rpx;
		}
	}
</style>


<script>
	import classList from '@/components/classList/index.vue'
	import pageList from '@/pagesA/components/list.vue'
	import ev from '@/pages/Evaluation/Evaluation.vue'
	export default {
		components: {
			classList,
			pageList,
			ev
		},
		// 精细保洁 理发 声卡效果精修 灯光/美颜 设备报修
		data() {
			return {
				list1: [{
					name: '全部',
					status: ""
				}, {
					name: '精细保洁',
					status: "精细保洁"
				}, {
					name: '理发',
					status: "理发"
				}, {
					name: '声卡效果精修',
					status: "声卡效果精修"
				}, {
					name: '灯光/美颜',
					status: "灯光/美颜"
				}, {
					name: '设备报修',
					status: "设备报修"
				}],
				page: 1,
				status: "",
				classPageList: [],
				pjshow: false,
				message: '',
				anchor_id: uni.getStorageSync('author_id'),
			}
		},
		onLoad() {
			this.getUserClass()
		},
		onReachBottom() {
			this.page++
			this.getUserClass()
		},
		methods: {
			changeEvent(item) {
				this.message = []
				console.log('changeEventchangeEventchangeEventchangeEvent', item.status);
				this.status = item.status
				this.page = 1
				this.classPageList = []
				this.getUserClass()
			},
			async getUserClass() {
				// 0已取消 1报名中 2已完成 3已评价 4已爽约
				const {
					data
				} = await this.$request(this.$Api.workList, {
					page: this.page,
					type: this.status
				}, "POST")
				if (data.code !== 0) return
				this.classPageList = this.classPageList.concat(data.data.list)
				console.log("classPageListclassPageList", this.classPageList)
			},
			upDate() {
				this.page = 1
				this.classPageList = []
				this.getUserClass()
			}
		}
	}
</script>